<?php
/**
 * @author wesley
 * @version v1.0
 * @time 2021/6/29 17:25
 * @desc
 */

namespace app\api\validate;


class IDMustBePositiveInt extends BaseValidate
{
 protected $rule = [
     'id'=>'require|isPositiveInter'
 ];
 protected function isPositiveInter($value, $field)
 {
     if(is_numeric($value) && is_int($value+0) && ($value+0)>0){
         return true;
     }else {
         return $field.'必须是正整数';
     }
 }
}